package com.j180.dao.petOwner;

import com.j180.bean.PetOwner;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface IPetOwnerDao {

    /**
     * 查询所有的宠主信息
     * @return
     */
    @ResultMap(value = "mapper.petOwnerMapper")
    public List<PetOwner> getAllPetOwners();

    /**
     * 根据id查询宠主信息
     * @param id
     * @return
     */
    @ResultMap(value = "mapper.petOwnerMapper")
    public PetOwner getPetOwnerById(@Param("id") int id);

    /**
     * 添加一个宠主
     * @param petOwner
     * @return
     */
    @ResultMap(value = "mapper.petOwnerMapper")
    public int insertPetOwner(PetOwner petOwner);

    /**
     * 删除某个宠主（根据id）
     * @param id
     * @return
     */
    @ResultMap(value = "mapper.petOwnerMapper")
    public int deletePetOwnerById(@Param("id") int id);

    /**
     * 更改宠主信息
     * @param petOwner
     * @return
     */
    @ResultMap(value = "mapper.petOwnerMapper")
    public int updatePetOwnerInfo(PetOwner petOwner);
}
